package com.tywj.test.lib.kotlin

/**
 * 测试起点和终点的位置选择
 */
fun main(args: Array<String>) {

    //当前的地址列表
    val listAddress = ArrayList<Int>()
    for (i in 0..9) {
        listAddress.add(i)
    }
    println("所有地址列表为：")
    listAddress.forEach { print(it) }
    println("-------------------------------------------")

    val startList = ArrayList<Int>()

    val endList = ArrayList<Int>()

    val selectedStartPosition = 2
    //如果起点选择了position  则  终点的位置为 listAddress.size-position

    endList.clear()

    for (k in selectedStartPosition + 1 until listAddress.size) {
        endList.add(k)
    }

    println("当前的位置为:$selectedStartPosition")
    println("终点可选的列表为：")
    endList.forEach { print(it) }
    println("-------------------------------------------")
}